package fr.univ.lille1.android.utils;

import android.annotation.SuppressLint;
import java.text.SimpleDateFormat;
import java.util.Date;

public final class Utils {
	private Utils() {
	}
	
	/**
	 * Convert a timestamp to a date with a pattern.
	 * 
	 * @param timestamp
	 *            Timestamp of the date.
	 * @param pattern
	 *            Pattern of the date.
	 * @return String who represent the pattern.
	 */
	@SuppressLint("SimpleDateFormat")
	public static String convertLongToDate(final long timestamp,
			final String pattern) {
		final SimpleDateFormat formater = new SimpleDateFormat(pattern);
		final Date date = new Date(timestamp);
		return formater.format(date);
	}

}
